{template 'ushop/member', 'header'}
<script type="text/javascript" src="{JS_PATH}formvalidator.js" charset="UTF-8"></script>
<script type="text/javascript" src="{JS_PATH}formvalidatorregex.js" charset="UTF-8"></script>
<script language="javascript" type="text/javascript" src="{JS_PATH}dialog.js"></script>
<script language="JavaScript">
<!--
$(function(){
	$.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
	$("#nickname").formValidator({onshow:"{L('input').L('nickname')}",onfocus:"{L('nickname').L('between_2_to_20')}"}).inputValidator({min:2,max:20,onerror:"{L('nickname').L('between_2_to_20')}"}).regexValidator({regexp:"ps_username",datatype:"enum",onerror:"{L('nickname').L('format_incorrect')}"}).ajaxValidator({
	    type : "get",
		url : "",
		data :"m=member&c=index&a=public_checknickname_ajax&userid={$memberinfo[userid]}",
		datatype : "html",
		async:'false',
		success : function(data){
            if( data == "1" ) {
                return true;
			} else {
                return false;
			}
		},
		buttons: $("#dosubmit"),
		onerror : "{L('already_exist')}",
		onwait : "{L('connecting_please_wait')}"
	}).defaultPassed();

	{$formValidator}
});

//-->
</script>
<style>
table {border_collapse:collapse; border-color:#e6e6e6; border-style:solid; border-width:0 1px 1px 0; margin-bottom:10px;}
td {border-color:#e6e6e6; border-style:solid; border-width:1px 0 0 1px; padding:5px 8px;}
</style>
<div style="width:1200px; margin:auto; _height:700px; min-height:700px;">
    <form name="form1" method="post" action="" id="mytaobao-junk">
        <div class="Main">
            <div id="Position" class="margin_b6" style="height:25px; line-height:25px; margin-bottom:1px;"> <a href="{APP_PATH}index.php?m=ushop">首页</a>&nbsp;&gt;&nbsp;<a href="{APP_PATH}index.php?m=member&c=index">我的ushop</a>&nbsp;&gt;&nbsp;<span>账户信息</span></div>
            <div class="right">
                <div class="o-mt">
                    <h2 style="background-color:#FFF;">账户信息</h2>
                </div>
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td align="right" width="20%">登录名:</td>
						<td align="left">{if $memberinfo['nickname']} {$memberinfo['nickname']} {else} {$memberinfo['username']}{/if}{if $memberinfo['email']}（{$memberinfo['email']}）{/if}</td>
					</tr>
					<tr>
						<td align="right">会员组：</td>
						<td align="left">{L('account_remain')}:{$memberinfo[amount]}元 ， {L('point')}：{$memberinfo[point]}</td>
					</tr>
				</table>
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td colspan="2" style="text-align:left; font-weight:bold;">新增收货地址:电话号码、手机号选填一项,其余均为必填项</td>
					</tr>
					<tr>
						<td align="right" width="20%">收货人姓名:</td>
						<td align="left"><input name="info[consignee_name]" id="_fm.d._0.f" type="text"></td>
					</tr>
					<tr>
						<td align="right" width="20%">所在地区:</td>
						<td align="left">
							<script language="javascript" src="{JS_PATH}ushop/city.js"></script>
							<select name="province"></select><select name="city"></select><select name="area"></select>
							<script language="javascript">new PCAS("province","city","area","北京市","市辖区","东城区");</script>
						</td>
					</tr>
					<tr>
						<td align="right" width="20%">详细地址:</td>
						<td align="left"><textarea name="info[consignee_more_address]" id="_fm.d._0.ad" rows="3" cols="60"></textarea></td>
					</tr>
					<tr>
						<td align="right" width="20%">邮政编码:</td>
						<td align="left"><input name="info[consignee_zip]" id="_fm.d._0.po" type="text"></td>
					</tr>
					<tr>
						<td align="right" width="20%">电话号码:</td>
						<td align="left">
							<input name="_fm.d._0.ph" title="区号" id="phoneSection" class="inputtext input-tel-code" type="text">
							-
							<input name="_fm.d._0.pho" title="电话号码" id="phoneCode" class="inputtext input-tel-num" type="text">
							-
							<input name="_fm.d._0.phon" title="分机" id="phoneExt" class="inputtext input-tel-cell" type="text">
						</td>
					</tr>
					<tr>
						<td align="right" width="20%">手机号码:</td>
						<td align="left"><input name="info[consignee_pho]" id="mobilePhone" class="inputtext input-long" type="text"></td>
					</tr>
                    <tr>
						<td align="right" width="20%">电子邮件:</td>
						<td align="left"><input name="info[consignee_email]" id="consignee_email" class="inputtext input-long" type="text"></td>
					</tr>
					<tr>
						<td align="right" width="20%">设为默认:</td>
						<td align="left"><input name="is_default" id="statusAddr" type="checkbox" value="1"></td>
					</tr>
					<tr>
						<td align="right"><input name="dosubmit" type="submit" id="dosubmit" value="保存" class="button"></td>
						<td></td>
					</tr>
				</table>
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
					<tr><td style="font-weight:bold; text-align:left;" colspan="6">已保存的有效地址</td></tr>
					<tr><td align="center">收货人</td><td align="center">所在地区</td><td align="center">详细地址</td><td align="center">邮编</td><td align="center">电话/手机</td><td align="center">电子邮件</td><td align="center">操作</td></tr>
					{loop $infos $data}
					<tr>
						<td align="center">{$data['consignee_name']}</td>
						<td align="center">{$data['consignee_address']}</td>
						<td align="center">{$data['consignee_more_address']}</td>
						<td align="center">{$data['consignee_zip']}</td>
						<td align="center">{if empty($data['consignee_pho'])}{$data['consignee_tel']}{else}{$data['consignee_pho']}{/if}</td>
                        <td align="center">{$data['consignee_email']}</td>
						<td align="center">
						<a href="index.php?m=ushop&c=user&a=address_delete&address_id={$data['address_id']}">删除</a>
						</td>
					</tr>
					{/loop}
				</table>
            </div>
            {template 'ushop/member', 'left'} </div>
    </form>
</div>
{template 'ushop', 'footer'}